﻿using HuiLian.Cloud.ViewModel;
using HuiLian.Cloud.View;
using HuiLian.Cloud.ViewModel.Base;
using HuiLian.Model.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace HuiLian.Cloud.ViewModel
{
    public class MemberWindowViewModel : ViewModelBase
    {
        private List<User> users = new List<User>()
        {
            new User(){ Id = 1, Available=120.0, ImagePath = "../Images/Foods/1.jpg", Remainder = 69, Telphone = "13844415810", Username = "张三"},
            new User(){ Id = 2, Available=120.0, ImagePath = "../Images/Foods/2.jpg", Remainder = 99, Telphone = "13625415810", Username = "李四"},
            new User(){ Id = 3, Available=110.0, ImagePath = "../Images/Foods/3.jpg", Remainder = 88, Telphone = "13667478410", Username = "王五"},
            new User(){ Id = 4, Available=102.0, ImagePath = "../Images/Foods/4.jpg", Remainder = 77, Telphone = "13667455810", Username = "马六"},
            new User(){ Id = 5, Available=130.0, ImagePath = "../Images/Foods/5.jpg", Remainder = 96, Telphone = "13667441810", Username = "赵启"},
            new User(){ Id = 6, Available=102.0, ImagePath = "../Images/Foods/6.jpg", Remainder = 58, Telphone = "13655415810", Username = "汪八"},
            new User(){ Id = 7, Available=102.0, ImagePath = "../Images/Foods/7.jpg", Remainder = 58, Telphone = "13655415810", Username = "汪八"}
        };

        public List<User> Users 
        { 
            get { return users; } 
            set { users = value; OnPropertyChanged("Users"); } 
        }

        #region
        public ICommand OnAddMemberClickCommand => new DelegateCommand((sender) =>
        {
            AddMemberWindow addMemberWindow = new AddMemberWindow();
            addMemberWindow.ShowDialog();
        });
        public ICommand OnDepositClickCommand => new DelegateCommand((sender) =>
        {
            DepositWindow depositWindow = new DepositWindow();
            depositWindow.ShowDialog();
        });
        #endregion
    }
}
